<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <!-- Ruquired meta tags -->
    <meta charset="utf-8">
    <meta name="viewpoint" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <!-- Bootstrap CSS -->
    <link   rel="stylesheet" href="/assets/plugins/bootstraps-5.3.3/bootstrap.min.css">
    <script src="/assets/plugins/bootstraps-5.3.3/bootstrap.bundle.min.js"></script>
    <script src="/assets/plugins/jquery-3.7.1/jquery.min.js"></script>
    <script src="/assets/plugins/showdownjs-2.1.0/showdown.min.js"></script>
    <style>
        pre {
            white-space: pre-wrap;       /* css-3 */
            white-space: -moz-pre-wrap;  /* Mozilla, since 1999 */
            /* white-space: -pre-wrap; */       /* Opera 4-6 */
            white-space: -o-pre-wrap;    /* Opera 7 */
            word-wrap: break-word;       /* Internet Explorer 5.5+ */
            background-color: #f8f8f8;
            border: 1px solid #dfdfdf;
            margin-top: 1.5em;
            margin-bottom: 1.5em;
            padding: 0.125rem 0.3125rem 0.0625rem;
        }

        pre code {
            background-color: transparent;
            border: 0;
            padding: 0;
        }
    </style>
    <title>
        {% block title %}
        {% endblock%}
    </title>
</head>

<body>
    <nav class="navbar navbar-expand-md navbar-dark bg-dark ps-4 pe-4">
      <a class="navbar-brand" href="/">MyBlog</a>
      <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNav">
        <span class="navbar-toggler-icon"></span>
      </button>
      <div class="collapse navbar-collapse" id="navbarNav">
        <ul class="navbar-nav me-auto">
            <li class="nav-item active">
                <a class="nav-link" href="{{ url_for('home_page') }}">主页</a>
            </li>
            <li class="nav-item">
                <a class="nav-link" href="{{ url_for('about_page') }}">关于</a>
            </li>
        </ul>
        {% if current_user.is_authenticated %}
        <ul class="navbar-nav">
            <li class="nav-item">
                <a class="nav-link" href="{{ url_for('create_article_page')}}">发布新文章</a>
            </li>
            <li class="nav-item">
                <a class="nav-link" href="{{ url_for('images_page')}}">图片管理</a>
            </li>
            <li class="nav-item">
                <a class="nav-link" href="{{ url_for('logout_page') }}">注销</a>
            </li>
        </ul>
        {% else %}
        <ul class="navbar-nav">
            <li class="nav-item">
                <a class="nav-link" href="{{ url_for('login_page') }}">登录</a>
            </li>
        </ul>
        {% endif %}
      </div>
    </nav>
    {% with messages = get_flashed_messages(with_categories=true) %}
        {% if messages %}
            {% for category, message in messages%}
                <div class="alert alert-{{ category }} alert-dismissible fade show" role="alert">
                    {{ message }}
                  <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
                </div>
            {% endfor%}
        {% endif %}
    {% endwith %}

{% block content %}
{% endblock %}


<p style="background:none;height: 5%;position: fixed;bottom: 0;width: 100%;text-align: center;">
    <a style="color:#000;text-decoration: none" href="https://beian.miit.gov.cn" target="_blank">鄂ICP备2024076959号-1</a></p>
</body>
</html>